<template>
<div>
  <h2>Login组件</h2>
  <h2>{{count}}</h2>
  <button @click="count++">累加</button>
</div>
</template>

<script>
export default {
  name: "Login",
  data(){
    return{
      count:0
    }
  },
  beforeRouteEnter(to,from,next){
    console.log(to,from,next,'进入路由前')
    next(()=>{
      console.log(this,'this')
    })
  },
  beforeRouteUpdate(to,from,next){
    console.log(to,from,next,'路由更新时')
    next()
  },
  beforeRouteLeave(to,from,next){
    console.log(to,from,next,'离开路由时')
  }
}
</script>

<style scoped>

</style>